use crate::mir::*;
use crate::tysys::*;

pub fn get_012_cond_expr(bufe: Expr) -> Expr {
    let e1 = Expr::new_read_u8_at(bufe.clone(), 0);
    let e1cast = Expr::new_cast(ValueType::USize, e1);
    let e2 = Expr::new_read_u8_at(bufe.clone(), 1);
    let e3 = Expr::new_read_u8_at(bufe, 2);
    let ec = Expr::new_binop(BinOp::Eq, e1cast, Expr::new_usize(2));
    let e = Expr::new_cond(ec, e2, e3);
    e
}
